package org.chen.jms;

import javax.jms.DeliveryMode;
import javax.jms.Destination;

import org.springframework.jms.core.JmsTemplate;

public class MessageSender {
	private JmsTemplate jmsTemplate;  
    private Destination destination;  
      
    public void send(Object message){  
        jmsTemplate.setDeliveryMode(DeliveryMode.PERSISTENT);  
        jmsTemplate.convertAndSend(destination,message);  
    }  
      
    public JmsTemplate getJmsTemplate() {  
        return jmsTemplate;  
    }  
    public void setJmsTemplate(JmsTemplate jmsTemplate) {  
        this.jmsTemplate = jmsTemplate;  
    }  
    public Destination getDestination() {  
        return destination;  
    }  
    public void setDestination(Destination destination) {  
        this.destination = destination;  
    }  
}
